Loading the workspace that has been saved in the first part of the data exploration.
# Entire workspace.
source_data("https://github.com/thomassie/Storms/blob/master/Exploration/StormDataWorkSpace.RData?raw=true")
## [1] "plot.wind" "dd" "plot.wind.dens.x"
## [4] "plot.wind.dens.y" "dd.org" "i"
## [7] "topn.WindKPH.Max" "year.min" "pal_tmm_01"
## [10] "plot.pres" "plot.wind.main" "year.max"
## [13] "n" "theme_tmm538" "plot.pressure.dens.x"
## [16] "p.min" "topn.Pressure.Min" "plot.pressure.dens.y"
## [19] "plot.pressure.1" "dd.pacific" "plot.pressure.2"
## [22] "plot.pressure.main" "topn.Duration" "d.max"
## [25] "w.max" "plot.dur" "dd.sum.year"
## [28] ".Random.seed" "dd.i" "plot.wind.1"
## [31] "dd.sum" "plot.wind.2" "n.select"
## [34] "dd.atlantic"
This time I will have a look at specific parts of the data set according to the choices I made before (i.e., a defined time interval; see first part of data exploration).
Let’s have a look at these storms. First, I want to see which are the storms that lasted the longest and where they ocurred. (I use a data set called ‘dd.s’ indicating a selection of the entire summary data set ‘dd.sum’.)
# renderLeaflet({
# What to show...?
dd.s <- topn.Duration
# Create an indicator for grouping.
groups = as.character(unique(dd.s$KeyPlus))
# The basic map.
map = leaflet(dd.s) %>%
# addProviderTiles(providers$CartoDB.Positron)
# addProviderTiles(providers$Esri.WorldTerrain)
addProviderTiles(providers$CartoDB.DarkMatter)
# Colors of a specific palette assigned to 'Maximum.Wind'.
groupColors = colorNumeric(palette = "YlOrRd", domain = dd$MaxWindKPH)
# groupColors = scale_colour_brewer("dd.s$Saffir.Simpson")
# Grouping!
for (g in groups) {
d = dd[dd$KeyPlus == g, ]
map = map %>%
addPolylines(data = d,
color = "#788E95",
group = g,
lng = ~ Lon,
lat = ~ Lat,
weight = 0.6,
opacity = 0.6) %>%
addCircleMarkers(data = d,
group = g,
lng = ~Lon,
lat = ~Lat,
color = ~groupColors(WindKPH),
# color = ~groupColors(Saffir.Simpson),
weight = 2,
# fill = FALSE,
radius = ~(WindKPH^1.2)/50,
# radius = ~sqrt(Maximum.Wind)*2,
popup = paste("Name: ", d$Name, "<br>",
"Date: ", date(d$DateTime), "<br>",
"Time: ", strftime(d$DateTime, format="%H:%M:%S",tz = "UTC"), "<br>",
"Status: ", d$Status, "<br>",
"Minimum in central Pressure: ", d$Pressure, "<br>",
"Maximum wind speed: ", d$WindKPH, "km/h"))
}
map %>%
addLayersControl(overlayGroups = groups)